import fs from 'node:fs'
import path from 'node:path'
import moment from 'moment'

export default async function (context) {
  // your custom code
  const dir = path.join(context.appOutDir, 'resources', 'app.asar.unpacked', 'resources')

  if (!fs.existsSync(dir)) {
    console.log("文件夹不存在")
    fs.mkdirSync(dir)
  }
  const file = path.join(dir, "bbinfo.json")
  fs.writeFileSync(file, JSON.stringify({
    dbsj: moment().format('YYYY-MM-DD HH:mm:ss')
  }, null, 2))
}